3.2.38 \(\int \tan (a+i \log (x)) \, dx\) [138]

Optimal. Leaf size=27 \[ i x-2 i e^{i a} \text {ArcTan}\left (e^{-i a} x\right ) \]

[Out]

I*x-2*I*exp(I*a)*arctan(x/exp(I*a))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {4587, 381, 396, 209} \begin {gather*} i x-2 i e^{i a} \text {ArcTan}\left (e^{-i a} x\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[a + I*Log[x]],x]

[Out]

I*x - (2*I)*E^(I*a)*ArcTan[x/E^(I*a)]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 381

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[x^(n*(p + q))*(b + a/x^n)^
p*(d + c/x^n)^q, x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IntegersQ[p, q] && NegQ[n]

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rule 4587

Int[Tan[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Int[((I - I*E^(2*I*a*d)*x^(2*I*b*d))/(1 + E^(2*I*a*
d)*x^(2*I*b*d)))^p, x] /; FreeQ[{a, b, d, p}, x]

Rubi steps

\begin {align*} \int \tan (a+i \log (x)) \, dx &=\int \tan (a+i \log (x)) \, dx\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 42, normalized size = 1.56 \begin {gather*} i x-2 i \text {ArcTan}(x \cos (a)-i x \sin (a)) \cos (a)+2 \text {ArcTan}(x \cos (a)-i x \sin (a)) \sin (a) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[a + I*Log[x]],x]

[Out]

I*x - (2*I)*ArcTan[x*Cos[a] - I*x*Sin[a]]*Cos[a] + 2*ArcTan[x*Cos[a] - I*x*Sin[a]]*Sin[a]

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 22, normalized size = 0.81

method result size
risch \(i x -2 i \arctan \left (x \,{\mathrm e}^{-i a}\right ) {\mathrm e}^{i a}\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(a+I*ln(x)),x,method=_RETURNVERBOSE)

[Out]

I*x-2*I*arctan(x*exp(-I*a))*exp(I*a)

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 122 vs. \(2 (17) = 34\).
time = 0.52, size = 122, normalized size = 4.52 \begin {gather*} {\left (i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \arctan \left (\frac {2 \, x \cos \left (a\right )}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}, \frac {x^{2} - \cos \left (a\right )^{2} - \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) - \frac {1}{2} \, {\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \log \left (\frac {x^{2} + \cos \left (a\right )^{2} + 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}{x^{2} + \cos \left (a\right )^{2} - 2 \, x \sin \left (a\right ) + \sin \left (a\right )^{2}}\right ) + i \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x)),x, algorithm="maxima")

[Out]

(I*cos(a) - sin(a))*arctan2(2*x*cos(a)/(x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2), (x^2 - cos(a)^2 - sin(a)^2)/(
x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2)) - 1/2*(cos(a) + I*sin(a))*log((x^2 + cos(a)^2 + 2*x*sin(a) + sin(a)^2
)/(x^2 + cos(a)^2 - 2*x*sin(a) + sin(a)^2)) + I*x

________________________________________________________________________________________

Fricas [A]
time = 2.48, size = 33, normalized size = 1.22 \begin {gather*} e^{\left (i \, a\right )} \log \left (x + i \, e^{\left (i \, a\right )}\right ) - e^{\left (i \, a\right )} \log \left (x - i \, e^{\left (i \, a\right )}\right ) + i \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x)),x, algorithm="fricas")

[Out]

e^(I*a)*log(x + I*e^(I*a)) - e^(I*a)*log(x - I*e^(I*a)) + I*x

________________________________________________________________________________________

Sympy [A]
time = 0.14, size = 27, normalized size = 1.00 \begin {gather*} i x + \left (- \log {\left (x - i e^{i a} \right )} + \log {\left (x + i e^{i a} \right )}\right ) e^{i a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*ln(x)),x)

[Out]

I*x + (-log(x - I*exp(I*a)) + log(x + I*exp(I*a)))*exp(I*a)

________________________________________________________________________________________

Giac [A]
time = 0.44, size = 30, normalized size = 1.11 \begin {gather*} \frac {2 \, \arctan \left (\frac {i \, x}{\sqrt {-e^{\left (2 i \, a\right )}}}\right ) e^{\left (2 i \, a\right )}}{\sqrt {-e^{\left (2 i \, a\right )}}} + i \, x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(a+I*log(x)),x, algorithm="giac")

[Out]

2*arctan(I*x/sqrt(-e^(2*I*a)))*e^(2*I*a)/sqrt(-e^(2*I*a)) + I*x

________________________________________________________________________________________

Mupad [B]
time = 2.17, size = 25, normalized size = 0.93 \begin {gather*} x\,1{}\mathrm {i}-\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}\,\mathrm {atan}\left (\frac {x}{\sqrt {{\mathrm {e}}^{a\,2{}\mathrm {i}}}}\right )\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(a + log(x)*1i),x)

[Out]

x*1i - exp(a*2i)^(1/2)*atan(x/exp(a*2i)^(1/2))*2i

________________________________________________________________________________________